package com.dotflat.satistics.repository.crm;


import com.dotflat.satistics.dto.UnitPriceDO;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/7/18
 * *******************************
 */
public interface ContractRepository {
    List<Map<String, Object>> findPaidAmountByAreaIdGroupByCreated(Date begin, Date end, String areaId);

    Double findPaidAmountByAreaId(Date begin, Date end, String areaId);

    List<Map<String, Object>> findPaidAmountByAreaIdsInGroupByAreaId(Date begin, Date end, String areaIds);

    List<Map<String, Object>> findMonthPaidAmountByAreaIdsInGroupByAreaId(String month, String areaIds);

    List<Map<String, Object>> findPaidRenewalAmountByAreaIdGroupByCreated(Date begin, Date end, String areaId);

    Double findPaidRenewalAmountByAreaId(Date begin, Date end, String areaId);

    List<Map<String, Object>> findPaidRenewalAmountByAreaIdsInGroupByAreaId(Date begin, Date end, String areaIds);

    List<Map<String, Object>> findMonthPaidRenewalAmountByAreaIdsInGroupByAreaId(String month, String areaIds);


    List<Map<String, Object>> findPaidCountByAreaIdGroupByCreated(Date begin, Date end, String areaId);

    Double findPaidCountByAreaId(Date begin, Date end, String areaId);

    List<Map<String, Object>> findPaidCountByAreaIdsInGroupByAreaId(Date begin, Date end, String areaIds);

    List<Map<String, Object>> findMonthPaidCountByAreaIdsInGroupByAreaId(String month, String areaIds);


    List<Map<String, Object>> findNurseryCountByAreaIdGroupByCreated(Date begin, Date end, String areaId);

    Long findNurseryCountByAreaId(Date begin, Date end, String areaId);

    List<Map<String, Object>> findNurseryCountByAreaIdsInGroupByAreaId(Date begin, Date end, String areaIds);

    List<Map<String, Object>> findMonthNurseryCountByAreaIdsInGroupByAreaId(String month, String areaIds);

    List<Map<String, Object>> findAmountByTypeAndAreaIdGroupByCreated(Date begin, Date end, Integer type, String areaId);

    Double findAmountByTypeAndAreaId(Date begin, Date end, Integer type, String areaId);

    List<Map<String, Object>> findAmountByTypeAndAreaIdsInGroupByAreaId(Date begin, Date end, Integer type, String areaIds);

    List<Map<String, Object>> findMonthAmountByTypeAndAreaIdsInGroupByAreaId(String month, Integer type, String areaIds);


    List<Map<String, Object>> findCountByAreaIdGroupByCreated(Date begin, Date end, String areaId);

    Long findCountByAreaId(Date begin, Date end, String areaId);

    List<Map<String, Object>> findCountByAreaIdsInGroupByAreaId(Date begin, Date end, String areaIds);

    List<Map<String, Object>> findMonthCountByAreaIdsInGroupByAreaId(String month, String areaIds);

    List<Map<String, Object>> findIntroduceCountByAreaIdGroupByCreated(Date begin, Date end, String areaId,String channelId);

    Long findIntroduceCountByAreaId(Date begin, Date end, String areaId,String channelId);

    List<Map<String, Object>> findIntroduceCountByAreaIdsInGroupByAreaId(Date begin, Date end, String areaIds,String channelId);

    List<Map<String, Object>> findMonthIntroduceCountByAreaIdsInGroupByAreaId(String month, String areaIds,String channelId);

    List<Map<String, Object>> findPaidAmountByAreaIdAndProductTypeGroupByPaidDate(Date begin, Date end, String areaId, Integer propertyType);


    List<Map<String, Object>> findPaidAmountByAreaIdAndProductType(Date begin, Date end, String areaId);


    List<Map<String, Object>> findCountByTypeAndAreaIdGroupByCreated(Date begin, Date end, String areaId, Integer type);

    List<Map<String, Object>> findCountByAreaIdGroupByType(Date begin, Date end, String areaId);

    List<Map<String, Object>> findPaidAmountByAreaIdGroupByMonth(Date begin, Date end, String areaId);


    //主页使用
    List<Map<String, Object>> findPaidAmountByAreaIdGroupByCreatedAndAreaId(Date begin, Date end, String areaIds);

    //主页客单价使用
    List<Map<String, Object>> findUnitPriceByAreaIdGroupByCreated(Date begin, Date end, String areaId);

    List<Map<String, Object>> findUnitPriceByAreaIdInGroupByAreaId(Date begin, Date end, String areaIds);

    Double findActualByAreaIdAndMonthAndPayStatus(Date begin, Date end, String id, int contractStatusStop);

    //主页可单概况
    UnitPriceDO findUnitPriceByAreaId(Date begin, Date end, String areaId);

    //主页可单概况
    UnitPriceDO findUnitPriceByAreaIdIn(Date begin, Date end, String areaIds);

    //麦麦助手 运营能力使用
    Double findCountByTypeAndArea(Date begin, Date end, int type, String areaId);

    Double findNurseryCountByStatusAndPayStatusAndAreaIdAndIsrewal(Date begin, Date end, int status, int payStatus, int isRenewal, String areaId);

    Double findNurseryCountByStatusAndPayStatusAndAreaId(Date begin, Date end, int contractStatusStop, int contractPayStatusOver, String id);

    Long findCountByChannelAndTypeAndStatusAndPayStatus(Date begin, Date end, String areaId, String channelId, int type, int contractStatus, int contractPayStatus);

}
